// import { useState } from "react";
import { Route, Routes } from "react-router-dom";
import Demo from "@/components/demo/demo2";
import { RequireAuth } from "@/components/AuthRoute/index";
import Home from "@/page/Home";
import Layout from "@/Layout";
const App = () => {
  return (
    <>
      <Routes>
        <Route path="/" element={<Layout />}>
          <Route index element={<Home />}></Route>
          {/* <AuthRoute path="/demo" element={<Demo />} />; */}
          <Route
            path="/demo"
            element={
              <RequireAuth>
                <Demo />
              </RequireAuth>
            }
          ></Route>
        </Route>
        <Route path="*" element={<h1>404 Not Found</h1>} />
      </Routes>
    </>
  );
};

export default App;
